#!/bin/bash

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
REVERB_HOME="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
ARGS=(${@// /\\ })

if [ ! -f $REVERB_HOME/target/reverb-core-*-jar-with-dependencies.jar ]; then
    echo "Can't find reverb-core-*-jar-with-dependencies.jar in $REVERB_HOME/target. "
    echo "Try running \"mvn clean compile assembly:single\""
    exit 1
fi

FATJAR=`ls $REVERB_HOME/target/reverb-core-*-jar-with-dependencies.jar | head -1`

java -Xmx512m -jar $FATJAR ${ARGS[*]}
